import Mock from 'mockjs'

const count = 20;

const List = [];

for (let i = 0; i < count; i++) {
  List.push(Mock.mock({
    'id|1': '@increment',
    date: Mock.Random.date(),
    username: 'admin',
    'rechargeCount|1-1000': 1000,
    'withdrawCount|1-1000': 1000,
    'rechargeMoney|10000-10000000': 10000000,
    'withdrawMoney|10000-10000000': 10000000,
    'betMoney|10000-10000000': 10000000,
    'payoutMoney|10000-10000000': 10000000,
    'profitMoney|10000-10000000': 10000000,
    'dividendMoney|10000-10000000': 10000000,
    'rebateMoney|10000-10000000': 10000000,
    'discountMoney|10000-100000': 100000,
    'otherMoney|10000-100000': 100000,
    'incomeMoney|10000-10000000': 10000000,
  }))
}

const SubList = [];

for (let i = 0; i < count; i++) {
  SubList.push(Mock.mock({
    'id|1': '@increment',
    date: Mock.Random.date(),
    username: '@first',
    'accountType|1': _.map(consts.ACCOUNT_TYPE, 'value'),
    'rechargeCount|1-1000': 1000,
    'withdrawCount|1-1000': 1000,
    'rechargeMoney|10000-10000000': 10000000,
    'withdrawMoney|10000-10000000': 10000000,
    'betMoney|10000-10000000': 10000000,
    'payoutMoney|10000-10000000': 10000000,
    'profitMoney|10000-10000000': 10000000,
    'dividendMoney|10000-10000000': 10000000,
    'rebateMoney|10000-10000000': 10000000,
    'discountMoney|10000-100000': 100000,
    'otherMoney|10000-100000': 100000,
    'incomeMoney|10000-10000000': 10000000,
  }))
}

const AgencyList = [];

for (let i = 0; i < count; i++) {
  AgencyList.push(Mock.mock({
    'id|1': '@increment',
    date: Mock.Random.date(),
    username: '@first',
    'rechargeCount|1-1000': 1000,
    'withdrawCount|1-1000': 1000,
    'rechargeMoney|10000-10000000': 10000000,
    'withdrawMoney|10000-10000000': 10000000,
    'betMoney|10000-10000000': 10000000,
    'payoutMoney|10000-10000000': 10000000,
    'profitMoney|10000-10000000': 10000000,
    'dividendMoney|10000-10000000': 10000000,
    'rebateMoney|10000-10000000': 10000000,
    'discountMoney|10000-100000': 100000,
    'otherMoney|10000-100000': 100000,
    'incomeMoney|10000-10000000': 10000000,
  }))
}

const AgencySubList = [];

for (let i = 0; i < count; i++) {
  AgencySubList.push(Mock.mock({
    'id|1': '@increment',
    date: Mock.Random.date(),
    username: '@first',
    'rechargeCount|1-1000': 1000,
    'withdrawCount|1-1000': 1000,
    'rechargeMoney|10000-10000000': 10000000,
    'withdrawMoney|10000-10000000': 10000000,
    'betMoney|10000-10000000': 10000000,
    'payoutMoney|10000-10000000': 10000000,
    'profitMoney|10000-10000000': 10000000,
    'dividendMoney|10000-10000000': 10000000,
    'rebateMoney|10000-10000000': 10000000,
    'discountMoney|10000-100000': 100000,
    'otherMoney|10000-100000': 100000,
    'incomeMoney|10000-10000000': 10000000,
  }))
}

const GameList = [];

for (let i = 0; i < count; i++) {
  GameList.push(Mock.mock({
    'id|1': '@increment',
    'platformType|1': _.map(consts.PLATFORM_TYPE, 'value'),
    'transferIn|1-1000000': 10000000,
    'transferOut|1-1000000': 10000000,
    'betPersonsCount|1-10000': 10000,
    'betTimes|1-10000': 10000,
    'betMoney|1-10000': 10000,
    'profitMoney|10000-10000000': 10000000,
    'rebateMoney|10000-10000000': 10000000,
    'averageBetMoney|10000-10000000': 10000000,
    'averageBetTimes|10000-10000000': 10000000,
  }))
}

const PlayerList = []

for (let i = 0; i < count; i++) {
  PlayerList.push(Mock.mock({
    'id|1': '@increment',
    date: Mock.Random.date(),
    username: 'admin',
    'rechargeMoney|10000-10000000': 10000000,
    'withdrawMoney|10000-10000000': 10000000,
    'rechargeServiceFee|1-100000': 100000,
    'withdrawServiceFee|1-100000': 100000,
    'manualAddMoney|1-10000000': 10000000,
    'manualReduceMoney|1-10000000': 10000000,
    'dividendMoney|1-10000000': 10000000,
    'rebateMoney|1-10000000': 10000000,
    'centerBalance|1-10000000': 10000000,
  }))
}

const SubPlayerList = []

for (let i = 0; i < count; i++) {
  SubPlayerList.push(Mock.mock({
    'id|1': '@increment',
    date: Mock.Random.date(),
    username: '@first',
    'accountType|1': _.map(consts.ACCOUNT_TYPE, 'value'),
    'rechargeMoney|10000-10000000': 10000000,
    'withdrawMoney|10000-10000000': 10000000,
    'rechargeServiceFee|1-100000': 100000,
    'withdrawServiceFee|1-100000': 100000,
    'manualAddMoney|1-10000000': 10000000,
    'manualReduceMoney|1-10000000': 10000000,
    'dividendMoney|1-10000000': 10000000,
    'rebateMoney|1-10000000': 10000000,
    'centerBalance|1-10000000': 10000000,
  }))
}

const TransactionList = []

for (let i = 0; i < count; i++) {
  TransactionList.push(Mock.mock({
    'id|1': '@increment',
    'transactionId|1': '@increment',
    username: '@first',
    'accountType|1': _.map(consts.ACCOUNT_TYPE, 'value'),
    'transactionType|1': _.map(consts.TRANSACTION_TYPE, 'value'),
    'money|1-10000000': 10000000,
    'fee|1-100000': 100000,
    'action|1': ['存款', '转入pt电子', '首存赠送100%活动', 'xx活动'],
    'centerBalance|1-10000000': 10000000,
    'comment': Mock.Random.ctitle(0,20),
    createTime: Mock.Random.date(),
  }))
}

export default {
  [api.REPORT_COMPANY_LIST]: () => ({
    code: 1,
    data: {
      total: List.length,
      items: List
    },
  }),
  [api.REPORT_COMPANY_SUB_LIST]: () => ({
    code: 1,
    data: {
      total: SubList.length,
      items: SubList
    },
  }),

  [api.REPORT_AGENCY_LIST]: () => ({
    code: 1,
    data: {
      total: AgencyList.length,
      items: AgencyList
    },
  }),

  [api.REPORT_AGENCY_SUB_LIST]: () => ({
    code: 1,
    data: {
      total: AgencySubList.length,
      items: AgencySubList
    },
  }),
  [api.REPORT_GAME_LIST]: () => ({
    code: 1,
    data: {
      total: GameList.length,
      items: GameList
    },
  }),
  [api.REPORT_PLAYER_LIST]: () => ({
    code: 1,
    data: {
      total: PlayerList.length,
      items: PlayerList
    },
  }),

  [api.REPORT_PLAYER_SUB_LIST]: () => ({
    code: 1,
    data: {
      total: SubPlayerList.length,
      items: SubPlayerList
    },
  }),

  [api.REPORT_TRANSACTION_LIST]: () => ({
    code: 1,
    data: {
      total: TransactionList.length,
      items: TransactionList
    },
  }),
}
